import { BaseEntity } from 'src/common/entitys/base';
import { UserEntity } from 'src/modules/user/entities/user.entity';
import { Entity, JoinColumn, OneToOne, PrimaryColumn, PrimaryGeneratedColumn } from 'typeorm';

@Entity({ name: 'sys_client', comment: '企业客户表' })
export class ClientEntity extends BaseEntity {
  @PrimaryGeneratedColumn({ name: 'client_id', comment: '企业用户Id' })
  clientId: number;

  @PrimaryColumn({ name: 'user_id', comment: '用户Id 关联用户表' })
  userId: number;

  @OneToOne(() => UserEntity)
  @JoinColumn({ name: 'user_id' })
  user: UserEntity;
}
